(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
  ["pages/user/money/recharge"], {
    "085c": function (e, t, n) {
      "use strict";
      var a;
      n.d(t, "b", (function () {
        return o
      })), n.d(t, "c", (function () {
        return c
      })), n.d(t, "a", (function () {
        return a
      }));
      var o = function () {
          var e = this,
            t = e.$createElement;
          e._self._c
        },
        c = []
    },
    "324f": function (e, t, n) {
      "use strict";
      n.r(t);
      var a = n("bdc4"),
        o = n.n(a);
      for (var c in a) "default" !== c && function (e) {
        n.d(t, e, (function () {
          return a[e]
        }))
      }(c);
      t["default"] = o.a
    },
    "3fa4": function (e, t, n) {
      "use strict";
      n.r(t);
      var a = n("085c"),
        o = n("324f");
      for (var c in o) "default" !== c && function (e) {
        n.d(t, e, (function () {
          return o[e]
        }))
      }(c);
      n("6b20");
      var s, i = n("f0c5"),
        u = Object(i["a"])(o["default"], a["b"], a["c"], !1, null, null, null, !1, a["a"], s);
      t["default"] = u.exports
    },
    "6b20": function (e, t, n) {
      "use strict";
      var a = n("7181"),
        o = n.n(a);
      o.a
    },
    7181: function (e, t, n) {},
    bdc4: function (e, t, n) {
      "use strict";
      (function (e) {
        Object.defineProperty(t, "__esModule", {
          value: !0
        }), t.default = void 0;
        var a = o(n("a34a"));

        function o(e) {
          return e && e.__esModule ? e : {
            default: e
          }
        }

        function c(e, t, n, a, o, c, s) {
          try {
            var i = e[c](s),
              u = i.value
          } catch (r) {
            return void n(r)
          }
          i.done ? t(u) : Promise.resolve(u).then(a, o)
        }

        function s(e) {
          return function () {
            var t = this,
              n = arguments;
            return new Promise((function (a, o) {
              var s = e.apply(t, n);

              function i(e) {
                c(s, a, o, i, u, "next", e)
              }

              function u(e) {
                c(s, a, o, i, u, "throw", e)
              }
              i(void 0)
            }))
          }
        }
        var i = {
          data: function () {
            return {
              loading: !1,
              disabled: !1,
              money: null,
              payList: []
            }
          },
          onLoad: function () {
            var t = this,
              n = "wap";
            n = "miniapp", e.getProvider({
              service: "payment",
              success: function (e) {
                e.provider.map((function (e) {
                  "alipay" == e ? t.payList.push({
                    name: "支付宝",
                    describe: "",
                    type: e,
                    method: n,
                    state: !0,
                    select: !1
                  }) : "wxpay" == e ? t.payList.push({
                    name: "微信支付",
                    describe: "推荐使用微信支付",
                    type: "wechat",
                    method: n,
                    state: !0,
                    select: !1
                  }) : "baidu" == e ? t.payList.push({
                    name: "百度收银台",
                    describe: "",
                    type: e,
                    method: n,
                    state: !0,
                    select: !1
                  }) : "appleiap" == e && t.payList.push({
                    name: "Apple支付",
                    describe: "",
                    type: "apple",
                    method: n,
                    state: !0,
                    select: !1
                  })
                }))
              }
            })
          },
          methods: {
            confirm: function () {
              var t = this,
                n = null;
              this.disabled || (this.money ? (this.payList.map((function (e, t, a) {
                e.select && (n = e)
              })), n ? (this.loading = !0, this.disabled = !0, e.login({
                success: function (e) {
                  t.wanlPay(n, e.code)
                },
                fail: function (t) {
                  e.showModal({
                    content: "无法获取微信code,原因为: " + t.errMsg,
                    showCancel: !1
                  })
                }
              })) : this.$wanlshop.msg("请选择支付方式")) : this.$wanlshop.msg("请输入充值金额"))
            },
            wanlPay: function (t) {
              var n = arguments,
                o = this;
              return s(a.default.mark((function c() {
                var s;
                return a.default.wrap((function (a) {
                  while (1) switch (a.prev = a.next) {
                    case 0:
                      s = n.length > 1 && void 0 !== n[1] ? n[1] : null, o.$api.post({
                        url: "/wanlshop/pay/recharge",
                        data: {
                          type: t.type,
                          method: t.method,
                          code: s,
                          money: o.money
                        },
                        success: function (n) {
                          if ("wechat" == t.type && "wap" == t.method && (o.loading = !1, e.showModal({
                              title: "微信支付",
                              content: "是否已完成支付",
                              success: function (e) {
                                e.confirm ? o.paySuccess() : e.cancel && console.log("用户点击取消")
                              }
                            }), window.location.href = n), "wechat" == t.type && "miniapp" == t.method && e.requestPayment({
                              appId: n.appId,
                              nonceStr: n.nonceStr,
                              package: n.package,
                              paySign: n.paySign,
                              signType: n.signType,
                              timeStamp: n.timeStamp,
                              success: function (e) {
                                o.paySuccess()
                              },
                              fail: function (t) {
                                e.showModal({
                                  content: "支付失败,原因为: " + t.errMsg,
                                  showCancel: !1
                                })
                              },
                              complete: function () {
                                o.loading = !1, o.disabled = !1
                              }
                            }), "alipay" == t.type && "wap" == t.method && (o.loading = !1, document.write(n)), ("alipay" == t.type || "wechat" == t.type) && "app" == t.method) {
                            var a = t.type;
                            "wechat" == t.type && (a = "wxpay"), e.requestPayment({
                              provider: a,
                              orderInfo: n,
                              success: function (e) {
                                console.log("success", e), o.paySuccess()
                              },
                              fail: function (t) {
                                e.showModal({
                                  content: "支付失败,原因为: " + t.errMsg,
                                  showCancel: !1
                                })
                              },
                              complete: function () {
                                o.loading = !1, o.disabled = !1
                              }
                            })
                          }
                        }
                      });
                    case 2:
                    case "end":
                      return a.stop()
                  }
                }), c)
              })))()
            },
            onSelect: function (e) {
              this.payList.map((function (t, n, a) {
                t.select = n == e && !t.select
              }))
            },
            emptyInput: function () {
              this.money = null
            },
            paySuccess: function () {
              
              this.loading = !1, this.$store.commit("user/setUserInfo", {
                money: this.$wanlshop.bcadd(this.$store.state.user.money, this.money)
              }), 
              
              this.$wanlshop.to("/pages/page/success?type=recharge")
            }
          }
        };
        t.default = i
      }).call(this, n("543d")["default"])
    },
    e8c4: function (e, t, n) {
      "use strict";
      (function (e) {
        n("77a0");
        a(n("66fd"));
        var t = a(n("3fa4"));

        function a(e) {
          return e && e.__esModule ? e : {
            default: e
          }
        }
        e(t.default)
      }).call(this, n("543d")["createPage"])
    }
  },
  [
    ["e8c4", "common/runtime", "common/vendor"]
  ]
]);